package models;
import java.util.Date;  
import java.util.List;
import java.util.ArrayList;
import javax.persistence.*;  
import play.db.jpa.Model;  

@Entity
public class MBlog extends Model{
    @ManyToOne
    public User author; //作者
    public String content; //微博内容 
    public Date createAt; //发表时间
    public String image; //微博附图, （暂定）
    public Long originId=0L; //转自那条微博的Id
    public Integer forwardCnt=0;//转发数
    public Integer commentCnt=0;//评论数
    
    
    public MBlog(User author, String content, Date createAt){
        this.author = author;
        this.content = content;
        this.createAt = createAt;
    }
    public MBlog(User author, String content, Date createAt,String image){
        this(author,content,createAt);
        this.image = image;
    }
    public void forward(){
        forwardCnt ++;
    }
    public void commend(){
        commentCnt ++;
    }
}
